/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', sans-serif;
  background: linear-gradient(135deg, #f6f9fc 0%, #d1e0f0 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  position: relative;
  overflow: hidden; /* 避免背景溢出 */
}

/* 添加背景装饰 */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3)), /* 蒙层透明度0.3 */
    url('logo.jpg'), 
    radial-gradient(circle at 20% 50%, rgba(91, 155, 213, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(74, 123, 200, 0.04) 0%, transparent 50%);
  background-size: cover;
  background-position: center;
  opacity: 1;
  pointer-events: none;
  z-index: -1;
}

.container {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(18px);
  max-width: 550px;
  width: 100%;
  padding: 45px 40px;
  border-radius: 16px;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.1),
    0 20px 48px rgba(0, 0, 0, 0.06),
    0 1px 6px rgba(0, 0, 0, 0.04);
  text-align: center;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.container:hover {
  transform: translateY(-4px);
  box-shadow:
    0 20px 45px rgba(0, 0, 0, 0.15),
    0 25px 60px rgba(0, 0, 0, 0.1),
    0 1px 8px rgba(0, 0, 0, 0.06);
}

h2 {
  color: #2d3748;
  margin-bottom: 35px;
  font-size: 28px;
  font-weight: 600;
  background: linear-gradient(135deg, #5B9BD5 0%, #4A7BC8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  user-select: none;
}

.input-group {
  margin-bottom: 15px;
  text-align: left;
  position: relative;
}

.input-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #4a5568;
  transition: color 0.3s ease;
  cursor: text;
}

.input-group label a {
  font-size: 12px;
  font-weight: 400;
  color: #5B9BD5;
  text-decoration: none;
  margin-left: 8px;
}

.input-group label a:hover {
  text-decoration: underline;
}



.input-group input {
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  transition: all 0.3s ease;
  outline: none;
  font-family: inherit;
  color: #2d3748;
}

.input-group input::placeholder {
  color: #a0aec0;
  transition: opacity 0.3s ease;
}

.input-group input:focus {
  border-color: #6195FF;
  background: #fbfcfd;
  transform: translateY(-1px);
}

.input-group input:focus::placeholder {
  opacity: 0.6;
}

.input-group input:focus + label,
.input-group.focused label {
  color: #6195FF;
}

.error-message {
  color: #ef3531;
  font-size: 14px;
  margin-top: 6px;
  display: block;
  opacity: 0;
  transform: translateY(-6px);
  transition: all 0.3s ease;
  min-height: 18px;
  user-select: none;
}

.error-message:not(:empty) {
  opacity: 1;
  transform: translateY(0);
}

.success-message {
  color: #38a169;
  font-size: 14px;
  margin: 20px 0 0 0;
  padding: 12px 16px;
  background: #f0fff4;
  border-radius: 8px;
  border-left: 3px solid #38a169;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  user-select: none;
}

.success-message:not(:empty) {
  opacity: 1;
  transform: translateY(0);
}

form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.button {
  background: #6195FF;
  color: rgb(250, 240, 240);
  padding: 14px 32px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  margin-top: 25px;
  font-family: inherit;
  user-select: none;
}

.button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  /* background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent); */
  transition: left 0.5s;
  pointer-events: none;
}

.button:hover::before {
  left: 100%;
}

.button:hover {
  transform: translateY(-2px);
  /* box-shadow: 0 8px 20px rgba(91, 155, 213, 0.3); */
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  background: #a0aec0;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.button:disabled::before {
  display: none;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
  text-align: left;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #ffffff;
  cursor: pointer;
}

.checkbox-item label {
  font-size: 13px;
  color: #4a5568;
  cursor: pointer;
  margin: 0;
  line-height: 1.4;
  font-weight: 600;
}

.checkbox-item a {
  color: #5B9BD5;
  text-decoration: none;
  transition: color 0.3s ease;
}

.checkbox-item a:hover {
  color: #4A7BC8;
  text-decoration: underline;
}

.auth-links {
  /* margin-top: 25px; */
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.auth-links p {
  color: #718096;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  user-select: none;
}

.auth-links a {
  color: #5B9BD5;
  text-decoration: none;
  font-weight: 600;
  font-weight: 500;
  transition: color 0.3s ease;
}

.auth-links a:hover {
  color: #4A7BC8;
  font-weight: 600;
  text-decoration: underline;
}

/* 登录中全屏加载覆盖层 */
#loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none; /* 默认隐藏 */
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#loading-overlay.show {
  display: flex; /* Flex 居中 */
}

.loading-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* 精准居中 */
  background: #fff;
  padding: 25px 35px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.25);
  min-width: 220px;
  max-width: 90%;
}



.loading-box p {
  margin-top: 18px;
  font-size: 16px;
  color: #333;
  font-weight: 500;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 5px solid #4285f4;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto; /* 居中关键 */
}


@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  body {
    padding: 15px;
  }

  .container {
    max-width: 100%;
    padding: 35px 30px;
    border-radius: 14px;
  }

  h2 {
    font-size: 24px;
    margin-bottom: 30px;
  }

  .input-group {
    margin-bottom: 14px;
  }

  .input-group input {
    padding: 12px 16px;
    font-size: 15px;
  }

  .button {
    padding: 12px 28px;
    font-size: 14px;
    margin-top: 20px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 30px 25px;
    border-radius: 12px;
  }

  h2 {
    font-size: 22px;
    margin-bottom: 25px;
  }

  .input-group {
    margin-bottom: 12px;
  }

  .checkbox-group {
    gap: 8px;
  }

  .checkbox-item label {
    font-size: 12px;
    font-weight: 600;
  }
}
